package org.taurusxi.feign.mvc;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import org.taurusxi.cloudbean.ApiModel;

import javax.servlet.http.HttpServletRequest;

/**
 * Created by chengxi on 2017/8/26.
 */

@RestController
public class HelloController {

    private static final Logger LOGGER = LoggerFactory.getLogger(HelloController.class);

    @Autowired
    private  HelloService helloService;

    @RequestMapping(path = "/feignIndex",method = RequestMethod.GET)
    public ApiModel index(HttpServletRequest request){
        LOGGER.info("=====<call trace,TraceId={},SpanId={}>=========",request.getHeader("X-B3-TraceId"),request.getHeader("X-B3-SpanId"));
        return helloService.hello();
    }
}
